![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@turf/combine
Advanced tools
@turf/combine is a module from the Turf.js library that allows you to combine multiple GeoJSON features into a single feature collection. This is particularly useful for merging multiple geometries into a single collection for easier manipulation and analysis.
Combine Multiple Features
This feature allows you to combine multiple GeoJSON features (points, lines, polygons) into a single feature collection. The code sample demonstrates combining two points and a line into one feature collection.
const turf = require('@turf/turf');
const point1 = turf.point([0, 0]);
const point2 = turf.point([2, 2]);
const line = turf.lineString([[1, 1], [3, 3]]);
const combined = turf.combine(turf.featureCollection([point1, point2, line]));
console.log(JSON.stringify(combined));
The geojson-merge package allows you to merge multiple GeoJSON files into one. It is similar to @turf/combine in that it combines multiple GeoJSON features, but it is more focused on merging files rather than individual features.
The geojson-flatten package is used to flatten nested GeoJSON geometries into a single-level feature collection. While @turf/combine focuses on combining features, geojson-flatten is useful for simplifying complex nested structures.
The geojson-utils package provides a variety of utility functions for working with GeoJSON data, including combining features. It offers a broader range of functionalities compared to @turf/combine, which is specialized for combining features.
Combines a FeatureCollection of Point, LineString, or Polygon features into MultiPoint, MultiLineString, or MultiPolygon features.
Parameters
fc
FeatureCollection<(Point | LineString | Polygon)> a FeatureCollection of any typeExamples
var fc = turf.featureCollection([
turf.point([19.026432, 47.49134]),
turf.point([19.074497, 47.509548])
]);
var combined = turf.combine(fc);
//addToMap
var addToMap = [combined]
Returns FeatureCollection<(MultiPoint | MultiLineString | MultiPolygon)> a FeatureCollection of corresponding type to input
This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.
Install this module individually:
$ npm install @turf/combine
Or install the Turf module that includes it as a function:
$ npm install @turf/turf
FAQs
turf combine module
The npm package @turf/combine receives a total of 0 weekly downloads. As such, @turf/combine popularity was classified as not popular.
We found that @turf/combine demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.